<html>
<head><meta charset="utf-8"><title>vec![] not working · t-compiler/rust-analyzer · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/index.html">t-compiler/rust-analyzer</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/vec!.5B.5D.20not.20working.html">vec![] not working</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="225180828"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/vec%21%5B%5D%20not%20working/near/225180828" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Eh2406 <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/vec!.5B.5D.20not.20working.html#225180828">(Feb 04 2021 at 16:09)</a>:</h4>
<p>I am getting errors like </p>
<div class="codehilite"><pre><span></span><code>{
    &quot;resource&quot;: &quot;/c:/.../pubgrub-rs/src/internal/core.rs&quot;,
    &quot;owner&quot;: &quot;rustc&quot;,
    &quot;code&quot;: {
        &quot;value&quot;: &quot;macro-error&quot;,
        &quot;target&quot;: {
            &quot;$mid&quot;: 1,
            &quot;external&quot;: &quot;https://rust-analyzer.github.io/manual.html#macro-error&quot;,
            &quot;path&quot;: &quot;/manual.html&quot;,
            &quot;scheme&quot;: &quot;https&quot;,
            &quot;authority&quot;: &quot;rust-analyzer.github.io&quot;,
            &quot;fragment&quot;: &quot;macro-error&quot;
        }
    },
    &quot;severity&quot;: 8,
    &quot;message&quot;: &quot;could not resolve macro `$crate::__export::force_expr`&quot;,
    &quot;source&quot;: &quot;rust-analyzer&quot;,
    &quot;startLineNumber&quot;: 47,
    &quot;startColumn&quot;: 40,
    &quot;endLineNumber&quot;: 47,
    &quot;endColumn&quot;: 63
}
</code></pre></div>
<p>every time there is a <code>vac![somthing]</code> im my code, Has this been reported?</p>



<a name="225181016"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/vec%21%5B%5D%20not%20working/near/225181016" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/vec!.5B.5D.20not.20working.html#225181016">(Feb 04 2021 at 16:10)</a>:</h4>
<p>Are you using the latest rust-analyzer version? I believe it is already fixed.</p>



<a name="225181284"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/vec%21%5B%5D%20not%20working/near/225181284" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/vec!.5B.5D.20not.20working.html#225181284">(Feb 04 2021 at 16:12)</a>:</h4>
<p>It should be fixed on the latest <em>Rust</em> nightly</p>



<a name="225181829"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/vec%21%5B%5D%20not%20working/near/225181829" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Eh2406 <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/vec!.5B.5D.20not.20working.html#225181829">(Feb 04 2021 at 16:15)</a>:</h4>
<p>Thanks for fixing it! Sorry for the noize. I look forward to having it fixed in the next update.</p>



<a name="225182024"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/vec%21%5B%5D%20not%20working/near/225182024" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/vec!.5B.5D.20not.20working.html#225182024">(Feb 04 2021 at 16:16)</a>:</h4>
<p>Hmm, this should already be fixed on the latest nightly Rust version</p>



<a name="225182072"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/vec%21%5B%5D%20not%20working/near/225182072" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/vec!.5B.5D.20not.20working.html#225182072">(Feb 04 2021 at 16:17)</a>:</h4>
<p>And it should only be a problem with a handful of nightly Rust versions, not beta or stable</p>



<a name="225183044"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/vec%21%5B%5D%20not%20working/near/225183044" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Eh2406 <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/vec!.5B.5D.20not.20working.html#225183044">(Feb 04 2021 at 16:21)</a>:</h4>
<p>That is odd, what dose an RA errore have to do with Rust version. But I can do a Rustup update if that may help.</p>



<a name="225183277"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/vec%21%5B%5D%20not%20working/near/225183277" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/vec!.5B.5D.20not.20working.html#225183277">(Feb 04 2021 at 16:22)</a>:</h4>
<p>rust-analyzer processes the Rust sysroot to know about the standard library, which is where <code>vec![]</code> is defined</p>



<a name="225183399"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/vec%21%5B%5D%20not%20working/near/225183399" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/vec!.5B.5D.20not.20working.html#225183399">(Feb 04 2021 at 16:22)</a>:</h4>
<p>It was changed to use <code>force_expr</code> to improve error messages, but that was defined using macros 2.0 syntax, which r-a doesn't yet support, hence the error</p>



<a name="225184712"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/vec%21%5B%5D%20not%20working/near/225184712" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Eh2406 <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/vec!.5B.5D.20not.20working.html#225184712">(Feb 04 2021 at 16:30)</a>:</h4>
<blockquote>
<p>nightly-x86_64-pc-windows-msvc updated - rustc 1.51.0-nightly (04caa632d 2021-01-30) (from rustc 1.51.0-nightly (d98d2f57d 2021-01-18))</p>
</blockquote>
<p>And it is working now! Thank you!</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>